import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/home/monitor/env_real_time_monitor_page_entity.dart';

EnvRealTimeMonitorPageEntity $EnvRealTimeMonitorPageEntityFromJson(Map<String, dynamic> json) {
  final EnvRealTimeMonitorPageEntity envRealTimeMonitorPageEntity = EnvRealTimeMonitorPageEntity();
  final String? dates = jsonConvert.convert<String>(json['dates']);
  if (dates != null) {
    envRealTimeMonitorPageEntity.dates = dates;
  }
  final String? categoryEn = jsonConvert.convert<String>(json['categoryEn']);
  if (categoryEn != null) {
    envRealTimeMonitorPageEntity.categoryEn = categoryEn;
  }
  final String? categoryZh = jsonConvert.convert<String>(json['categoryZh']);
  if (categoryZh != null) {
    envRealTimeMonitorPageEntity.categoryZh = categoryZh;
  }
  final int? num = jsonConvert.convert<int>(json['num']);
  if (num != null) {
    envRealTimeMonitorPageEntity.num = num;
  }
  return envRealTimeMonitorPageEntity;
}

Map<String, dynamic> $EnvRealTimeMonitorPageEntityToJson(EnvRealTimeMonitorPageEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['dates'] = entity.dates;
  data['categoryEn'] = entity.categoryEn;
  data['categoryZh'] = entity.categoryZh;
  data['num'] = entity.num;
  return data;
}

extension EnvRealTimeMonitorPageEntityExtension on EnvRealTimeMonitorPageEntity {
  EnvRealTimeMonitorPageEntity copyWith({
    String? dates,
    String? categoryEn,
    String? categoryZh,
    int? num,
  }) {
    return EnvRealTimeMonitorPageEntity()
      ..dates = dates ?? this.dates
      ..categoryEn = categoryEn ?? this.categoryEn
      ..categoryZh = categoryZh ?? this.categoryZh
      ..num = num ?? this.num;
  }
}